/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { HttpSrv } from 'lfun-bg-comp';
import type { TNewTeachers } from './types';
import { ImportParams } from '..';
/** 新教工 */
export class NewTeachersSrv {
  /** 获取新教工列表 */
  public static async list(params: TNewTeachers.TReqNewTeachersParams) {
    return HttpSrv().get(`/school/v1/new-teachers/page`, { params: { ...params } });
  }

  /** 新增 */
  public static async add(params: any) {
    return HttpSrv().post('/school/v1/new-teachers/newteacher', params);
  }

  /** 更新 */
  public static async update(params: any) {
    return HttpSrv().put('/school/v1/new-teachers/newteacher', params);
  }

  /** 删除 */
  public static async delete(id: any) {
    return HttpSrv().delete(`/school/v1/new-teachers/newteacher?teacher_id=${id}`);
  }

  /** 详情 */
  public static async detail(id: any) {
    return HttpSrv().get(`/school/v1/new-teachers/newteacher?teacher_id=${id}`);
  }

  /** 基础信息 */
  public static async info(id: any) {
    return HttpSrv().get(`/school/v1/new-teachers/newteacherinfo?teacher_id=${id}`);
  }

  /** 基础信息edit更新 提交 */
  public static async infoEditSubmit(params: any) {
    return HttpSrv().put('/school/v1/new-teachers/newteacherinfo', params);
  }

  /** 基础信息edit更新 保存 */
  public static async infoEditSave(params: any) {
    return HttpSrv().put('/school/v1/new-teachers/newteacherinforesave', params);
  }

  /** 基础信息新增提交 */
  public static async infoAddSubmit(params: any) {
    return HttpSrv().put('/school/v1/new-teachers/newteacherinfosubmit', params);
  }

  /** 基础信息新增保存 */
  public static async infoAddSave(params: any) {
    return HttpSrv().post('/school/v1/new-teachers/newteacherinfosave', params);
  }

  // 我发起列表
  public static async listLaunch(params: TNewTeachers.TReqNewTeachersParams) {
    return HttpSrv().get(`/school/v1/new-teachers/new-teacher-launch`, { params });
  }

  // 我审批列表
  public static async listApproval(params: TNewTeachers.TReqNewTeachersParams) {
    return HttpSrv().get(`/school/v1/new-teachers/new-teacher-approval`, { params });
  }

  public static async approved(teacher_id: any, process_instance_id: any, reason: string) {
    return HttpSrv().patch(`/school/v1/new-teachers/entry-approved`, { teacher_id, process_instance_id, reason });
  }

  public static async rejected(teacher_id: any, process_instance_id: any, reason: string) {
    return HttpSrv().patch(`/school/v1/new-teachers/entry-rejected`, { teacher_id, process_instance_id, reason });
  }

  public static async revoked(teacher_id: any, process_instance_id: any, reason: string) {
    return HttpSrv().patch(`/school/v1/new-teachers/entry-revoked`, { teacher_id, process_instance_id, reason });
  }

  public static async importNewTeacher(params: ImportParams) {
    return HttpSrv().post(`/school/v1/new-teachers/new-teacher-import`, params);
  }

  // public static async exportNewTeacher(params: TNewTeachers.TReqNewTeachersParams) {
  //   return HttpSrv().post(`/school/v1/new-teachers/new-teacher-export`, params);
  // }
}
